package com.vue.admin.system.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.example.annotations.Autowired;
import com.example.annotations.Service;
import com.example.db.SqlBuilder;
import com.example.db.TableService;
import com.example.db.model.IPage;
import com.vue.admin.system.model.SysUser;
import com.vue.admin.system.service.SysUserService;

/**
 * @Classname SysUserServiceImpl
 * @Description TODO
 * @Date 2022/8/21 13:13
 * @Created by XiongXiong
 * @Author: X.I.O
 */
@Service
public class SysUserServiceImpl implements SysUserService {

    @Autowired
    TableService tableService;

    @Override
    public SysUser getById(Object id) {
        SysUser sysUser=tableService.getOneById(id,SysUser.class);
        return sysUser;
    }

    @Override
    public SysUser updateById(SysUser sysUser) {
        tableService.updateById(sysUser,SysUser.class);
        return sysUser;
    }

    @Override
    public SysUser save(SysUser sysUser) {
        tableService.save(sysUser,SysUser.class);
        return sysUser;
    }

    @Override
    public IPage<SysUser> page(JSONObject obj) {
        SqlBuilder sqlBuilder=tableService.getSqlBuilder(SysUser.class);
        Integer pageNum=obj.getInteger("pageNum");
        Integer pageSize=obj.getInteger("pageSize");
        return null;
    }
}
